<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    #outProgress{
        width: 500px;
        height: 25px;
        border: 1px solid black;
    }
    #inProgress{
        width: 0px;;
        height: 25px;
        background: cornflowerblue;
        position: relative;
    }
    span{
        position:absolute;
        right: -53px;
    }
    </style>
</head>
<body>
    <div id="outProgress">
        <div id="inProgress">
            <span id="tex"></span>
        </div>
    </div>
    <script>
        var num=0;
        var timer=setInterval(function(){
            num+=2;
            inProgress.style.width=num+"px";
            var res=window.getComputedStyle(outProgress, null).getPropertyValue("width");
            tex.innerHTML=(num/parseInt(res)*100).toFixed(2)+'%';
            
            
            if(num>= parseInt(res))
                clearInterval(timer);
        },70) 
        
    </script>
</body>

</html>